package com.authine.cloudpivot.ext.enums.kingdee;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @Author: 李国祥
 * 金蝶科目
 * @Date: 2019/7/25 14:57
 * @Version 1.0
 */
public enum FAccountIdEnum {

    //库存商品-云平台
    stock01(1, "1405.03"),
    //库存商品-转采
    stock02(2, "1405.02"),

    //发出商品 —云平台
    release01(3, "1406"),
    //发出商品 —转采
    release02(4, "1406"),


    //应付账款-转采-供应商
//    payable0101(5,"2202.01.01"),
    payable0101(5, "2202.05.01"),
    //应付账款-转采-暂估应付
//    payable0102(6,"2202.02.02"),
    payable0102(6, "2202.05.02"),
    //应付账款—云平台—供应商
    payable0301(7, "2202.03.01"),
    //应付账款—云平台—暂估应付
    payable0302(8, "2202.03.02"),


    //------应交税费-应交增值税--进项税额
    //16%
    tax010701(9, "2221.01.07.01"),
    //10%
    tax010702(10, "2221.01.07.02"),
    //6%
    tax010703(11, "2221.01.07.03"),
    //5%
    tax010704(12, "2221.01.07.04"),
    //3%
    tax010705(13, "2221.01.07.05"),
    //1.5%
    tax010706(14, "2221.01.07.06"),
    //13%
    tax010707(15, "2221.01.07.07"),
    //9%
    tax010709(16, "2221.01.07.08"),

    //------应交税费_应交增值税_销项税额---------
    //16%
    tax010202(17, "2221.01.02.02"),
    //6%
    tax010203(18, "2221.01.02.03"),
    //10%
    tax010205(19, "2221.01.02.05"),
    //13%
    tax010206(20, "2221.01.02.06"),
    //9%
    tax010207(21, "2221.01.02.07"),
    //------------------------------------------

    //进项税额转出
    tax0104(22, "2221.01.04"),

    //主营业务成本-云平台
    main02(23, "5401.02"),
    //主营业务收入-云平台-货款
    income0601(24, "5001.06.01"),
    //主营业务收入_云平台_平台服务费
    income0602(25, "5001.06.02"),
    //主营业务收入_云平台_金融服务费
    income0603(26, "5001.06.03"),

    //银行存款
    bank(27, "1003"),
    //支付宝
    alipay(28, "1012.01"),
    //应收票据
    receivable(29, "1121"),

    //应收账款-云平台-货款
    accounts0601(30, "1122.06.01"),
    //应收账款-云平台-服务费
    accounts0602(31, "1122.06.02"),
    //应收账款-云平台-货款
    accounts0603(32, "1122.06.03"),
    //现金
    cash1001(33, "1001"),

    //1%
    tax010211(34, "2221.01.07.11"),
    // 应收账款_云平台_代购_货款
    accounts060301(35, "1122.06.03.01"),
    //应收账款_云平台_代购_服务费
    accounts060302(36, "1122.06.03.02");
    private Integer id;

    @JsonProperty("FNumber")
    private String fNumber;

    FAccountIdEnum(Integer id, String fNumber) {
        this.id = id;
        this.fNumber = fNumber;
    }


    public static FAccountIdEnum get(Integer code) {
        for (FAccountIdEnum c : FAccountIdEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    /**
     * 根据id获取number
     *
     * @param
     * @return
     */
    public static String getDes(int id) {
        for (FAccountIdEnum e : FAccountIdEnum.values()) {
            if (e.id == id) {
                return e.fNumber;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "id:" + id + ", fNumber:" + fNumber;
    }

    public String getFNumber() {
        return fNumber;
    }
}
